package com.tansun.ruledata.entity;

import java.util.Date;

import org.hibernate.validator.constraints.Length;

/**
 * 版本信息Entity
 *
 * @author lxs
 * @version 2017-02-28
 */
public class RuleVersioninfo extends RuleBaseEntity<RuleVersioninfo> {

    private static final long serialVersionUID = 1L;
    private String manageId;        // 规则管理ID
    private String projectCode;        // 规则库编码
    private String modelType;        // 规则模型类型
    private String version;        // 规则模型版本号
    private String ruleContent;        // 规则内容
    private String createDate;
    private String dataVersion;

    private String enterPointer;//调用编码
    /**
     * 规则模型编号
     */
    private String modelCode;
    /**
     * 规则模型名称
     */
    private String modelName;
    /**
     * 1代表是被引用
     */
    private String refModelStatus;
    public RuleVersioninfo() {
        super();
    }

    public RuleVersioninfo(String id) {
        super(id);
    }

    @Length(min = 1, max = 64, message = "规则管理ID长度必须介于 1 和 64 之间")
    public String getManageId() {
        return manageId;
    }

    public void setManageId(String manageId) {
        this.manageId = manageId;
    }

    @Length(min = 1, max = 50, message = "规则库编码长度必须介于 1 和 50 之间")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    @Length(min = 0, max = 50, message = "规则模型类型长度必须介于 0 和 50 之间")
    public String getModelType() {
        return modelType;
    }

    public void setModelType(String modelType) {
        this.modelType = modelType;
    }

    @Length(min = 0, max = 10, message = "规则模型版本号长度必须介于 0 和 10 之间")
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
	public String getRuleContent() {
		return ruleContent;
	}

	public void setRuleContent(String ruleContent) {
		this.ruleContent = ruleContent;
	}

	public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

  
	public String getEnterPointer() {
		return enterPointer;
	}

	public void setEnterPointer(String enterPointer) {
		this.enterPointer = enterPointer;
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public String getDataVersion() {
		return dataVersion;
	}

	public void setDataVersion(String dataVersion) {
		this.dataVersion = dataVersion;
	}

	public String getRefModelStatus() {
		return refModelStatus;
	}

	public void setRefModelStatus(String refModelStatus) {
		this.refModelStatus = refModelStatus;
	}

	public String getSql() {
		return "INSERT INTO rule_versioninfo(id,manage_id,project_code,model_type,model_code,version,rule_content,enter_pointer,create_date,data_version,refmodelstatus)values(?,?,?,?,?,?,?,?,?,?,?)";
	}
	
	public String getExeSql() {
		return "INSERT INTO rule_exe_versioninfo(id,manage_id,project_code,model_type,model_code,version,rule_content,enter_pointer,create_date,data_version,refmodelstatus)values(?,?,?,?,?,?,?,?,?,?,?)";
	}
	
	public Object[] getArgs(String timeStamp) {
		return new Object[] {this.id,this.manageId,this.projectCode,this.modelType,this.modelCode,this.version,this.ruleContent,this.enterPointer,new Date(),timeStamp,this.refModelStatus};
	}
}